package com.tangding.service.dao.user;

import java.io.Serializable;

import org.bson.Document;
import org.springframework.stereotype.Repository;

import com.tangding.common.exception.GException;
import com.tangding.service.db.BaseMongoRepository;
import com.tangding.service.db.MongoDBOption;
import com.tangding.service.entity.user.User;

/**
 * @description 
 *
 * @author Ranger
 * @version 2016年8月13日_下午3:40:06
 *
 */
@Repository
public class UserRepository extends BaseMongoRepository<User, Serializable> {
	
	@Override
	protected void init() {
		option = new MongoDBOption("ACCOUNT", "user");
	}
	
	public User findUsersByUid(String username) throws GException {
		Document condition = new Document();
		condition.put("uid", username);
		User data = findOne(condition);
		return data;
	}
}
